home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Utilities / Installers / Smaller Installer 2.0.1 / Preinstalled version / Examples / Hook Procedure Examples / SIHookProc.h
Encoding:
C/C++ Source or Header  |  1996-07-26  |  4.1 KB  |  80 lines  |  [TEXT/CWIE]

  1. /******************************************************************************
  2.     Smaller Installer © 1996 Bill Goodman, All Rights Reserved
  3. *******************************************************************************
  4.  
  5.     This header defines the Installer Hook Procedure interface.
  6.  
  7. ******************************************************************************/
  8.  
  9.  
  10. /******************************************************************************
  11.     Installer Hook Parameter Block Definition
  12. ******************************************************************************/
  13. typedef struct
  14.     {
  15.     short function;                    // Function to perform:
  16. #define siHookFirst                        1    // First call
  17. #define siHookLast                        2    // Last call
  18. #define siHookChangeSelection            3    // Change selection
  19. #define siHookBeginOperation            4    // Begin operation
  20. #define siHookBeforeItem                5    // Before item
  21. #define siHookAfterItem                    6    // After item
  22. #define siHookEndOperation                7    // End operation
  23.  
  24.     short targetVRefNum;                // Volume reference number of target volume
  25.  
  26.     unsigned short groupAPFlags;    // Group A-P flags (MSB->P...LSB->A)
  27.     Byte groupQUSel;                    // Group Q-U selector (0->Q...4->U)
  28.     Byte groupVZSel;                    // Group V-Z selector (0->V...4->Z)
  29.     unsigned long group32Flags;    // Group 01-32 flags (MSB->32...LSB->01)
  30.     unsigned long group64Flags;    // Group 33-64 flags (MSB->64...LSB->33)
  31.     unsigned long group96Flags;    // Group 65-96 flags (MSB->96...LSB->65)
  32.     unsigned long groupEnvironFlags;    // Group environment flags
  33. #define siHookEnvBlackAndWhite        0x00000001    // %B: Black & White (monochrome)
  34. #define siHookEnvColor                    0x00000002    // %C: Color
  35. #define siHookEnvSystem6OrLower        0x00000004    // %6: System 6 or older
  36. #define siHookEnvSystem7OrHigher        0x00000008    // %7: System 7 or newer
  37. #define siHookEnv68KProcessor            0x00000010    // %M: 680X0 processor
  38. #define siHookEnvPPCProcessor            0x00000020    // %P: PowerPC processor
  39. #define siHookEnv68KWithFPU            0x00000040    // %F: 680X0 processor with FPU
  40. #define siHookEnv68KWithoutFPU        0x00000080    // %G: 680X0 processor without FPU
  41. #define siHookEnvInstallFat            0x00000100    // %U: Install universal version of fat binaries
  42. #define siHookEnvInstall68KOnly        0x00000200    // %N: Install 680X0-only version of fat binaries
  43. #define siHookEnvInstallPPCOnly        0x00000400    // %Q: Install PowerPC-only version of fat binaries
  44.  
  45.     StringPtr passwordPtr;            // Pointer to password string
  46.  
  47.     long filesRemaining;                // Number of files remaining to install/remove
  48.     long bytesRemaining;                // Number of bytes of data remaining to install/remove
  49.  
  50.     Boolean doingRemove;                // Non-zero if doing remove operation
  51.     Boolean anyItemsSkipped;        // Non-zero if any item has been skipped during operation
  52.     Boolean itemWasSkipped;            // Non-zero if this item was skipped
  53.     Boolean aborted;                    // Non-zero if operation was aborted
  54.  
  55.     short desVRefNum;                    // Volume reference number of destination volume
  56.     long desDirID;                        // Directory ID of destination directory
  57.     Str63 itemName;                    // Name of file or folder to install/remove
  58.     Boolean itemIsFolder;            // Non-zero if item is a folder
  59.     Boolean filler1;                    // Filler byte
  60.     OSType fileType;                    // File type (not valid for folders)
  61.     OSType fileCreator;                // File creator (not valid for folders)
  62.     unsigned long createDate;        // Creation date (not valid for folders)
  63.     unsigned long lastModDate;        // Last modification date (not valid for folders)
  64.     long rsrcForkLen;                    // Length of resource fork (not valid for folders)
  65.     long dataForkLen;                    // Length of data fork (not valid for folders)
  66.     long itemInfo;                        // Reference passed from BeforeItem call to AfterItem call
  67.  
  68.     short result;                        // Returned result
  69. #define siHookNoErr                        0    // No error
  70. #define siHookQuit                        1    // Stop current operation and terminate installer
  71. #define siHookAbort                        2    // Stop current operation and resume installer
  72. #define siHookSkip                        3    // Skip this item
  73. #define siHookItemDone                    4    // Item was installed/removed by hook
  74.     } SIHookParmBlk;
  75.  
  76.  
  77. /******************************************************************************
  78.     Hook Procedure Definition
  79. ******************************************************************************/
  80. typedef pascal void (*SIHookProcPtr)(SIHookParmBlk *parmBlk);